cmake_minimum_required(VERSION 3.10)

cmake_policy(SET CMP0074 NEW)
find_package(Boost REQUIRED COMPONENTS program_options system date_time)

include_directories(${Boost_INCLUDE_DIRS})
include_directories(inc)

link_directories(${LIBRARY_OUTPUT_PATH})

aux_source_directory(src SRC)

add_executable(dmmodbus ${SRC})

DB_SELECT(dmmodbus)

target_link_libraries(dmmodbus oslog protocol osprotocol scada osascom oscom dmsys osmsg options osdb dmos string misc env tinyxml json ${Boost_LIBRARIES})

if( NOT WIN32 )
	target_link_libraries(dmmodbus osio pthread)
endif()

install(TARGETS dmmodbus RUNTIME)